package com.blockmeta.bbs.immodule.widget;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.Animation;
import android.widget.TextView;

import com.blockmeta.bbs.immodule.R;

import razerdp.basepopup.BasePopupWindow;

/**
 * Created by author on 2018/1/4.
 */

public class MyBottomPopupWindow extends BasePopupWindow {
    public TextView tx1,tx2,tx3,tx4;
    private View popupView;

    public MyBottomPopupWindow(Context context) {
        super(context);
        bindEvent();
    }

    @Override
    protected Animation initShowAnimation() {
        return getTranslateVerticalAnimation(1f, 0, 500);
    }

    @Override
    protected Animation initExitAnimation() {
        return getTranslateVerticalAnimation(0, 1f, 500);
    }

    @Override
    public View getClickToDismissView() {
        return popupView.findViewById(R.id.click_to_dismiss);
    }

    @Override
    public View onCreatePopupView() {
        popupView = LayoutInflater.from(getContext()).inflate(R.layout.popup_slidefrom_bottom, null);
        return popupView;
    }

    @Override
    public View initAnimaView() {
        return popupView.findViewById(R.id.popup_anima);
    }

    private void bindEvent() {
        if (popupView != null) {
            tx1 = (TextView) popupView.findViewById(R.id.popup_tx_1);
            tx2 = (TextView) popupView.findViewById(R.id.popup_tx_2);
            tx3 = (TextView) popupView.findViewById(R.id.popup_tx_3);
            tx4 = (TextView) popupView.findViewById(R.id.popup_tx_4);
        }
    }
}
